<?php
namespace App\Http\ViewComposers\Buz;


use App\Models\AssetCount;
use Illuminate\Contracts\View\View;
use Illuminate\Support\Facades\Auth;

class RemitComposer
{
    public function compose(View $view)
    {
        $user = \Session::get('user');
        $assets = AssetCount::byUserId($user->id)->first();
        $asset = [
            'available' => number_format($assets->available, 2, '.', ''),
            'recharge_frozen' => number_format($assets->recharge_frozen, 2, '.', ''),
            'withdraw_frozen' => number_format($assets->withdraw_frozen, 2, '.', ''),
            'total' => number_format($assets->total, 2, '.', ''),
        ];
        $view->with(compact('asset'));
    }
}
